import App from './App'
import i18n from './lang/i18n'
import http from './common/http.js'

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
Vue.prototype.$http = http
Vue.prototype.$config={prefix:'ZGJ',order:false,voice:0,promotor:null}
Vue.filter('sts', (val) => {
	if (val == 1) return "待分配"
	if (val == 5) return "待报价"
	if (val == 10) return "已报价"
	return ''
})
Vue.filter('orderState', (val) => {
	if (val == 1) return "创建"
	if (val == 5) return "待发货"
	if (val == 10) return "已发货"
	if (val == 99) return "完成"
	return val
})
Vue.filter('money', (val) => {
	
	return (val / 100.0).toFixed(2)
})
Vue.filter('scoreType', (val) => {
	if (val == 1) return "充值"
	if (val == 101) return "交易扣减积分"
	if (val == 201) return "经销商交易返积分"
	if (val == 202) return "推广交易返积分"
	return ''
})
App.mpType = 'app'
String.prototype.hashCode = function() {
	for (var a = 31, b = 0, c = this.length; b < c;)
		a ^= (a << 5) + (a >> 2) + this.charCodeAt(b++);
	return a
}

const app = new Vue({
	i18n,
	...App
})
app.$mount()
// #endif


// #ifdef VUE3
import {
	createSSRApp
} from 'vue'

export function createApp() {
	const app = createSSRApp(App)
	app.use(i18n)
	return {
		app
	}
}
// #endif